<g:set var="comments" value="${commentable.comments}"></g:set>

<div id="addComment" class="addComment">


        <n:isLoggedIn>
            <h2 class="addCommentTitle">
			    <g:message code="comment.add.title" default="Post a Comment"></g:message>
            </h2>
            <div id="addCommentContainer" class="addCommentContainer" >
                <div class="addCommentDescription">
                    <g:message code="comment.add.description" default=""></g:message>
                </div>
                <a name="commentEditor"></a>
                <g:formRemote name="addCommentForm" url="[controller:'commentable',action:'add']" update="comments">
                    <g:textArea id="commentBody" class="span-19" name="comment.body" /> <br />
                    <g:hiddenField name="update" value="comments" />
                    <g:hiddenField name="commentLink.commentRef" value="${commentable.id}" />
                    <g:hiddenField name="commentLink.type" value="${commentable.class.name}" />
                    <g:hiddenField name="commentPageURI" value="${request.forwardURI}"></g:hiddenField>
                    <g:submitButton name="${g.message(code:'comment.post.button.name',
                                                     'default':'Post')}"></g:submitButton>
                </g:formRemote>
            </div>
        </n:isLoggedIn>
        <n:isNotLoggedIn>
            <h2 class="addCommentTitle">
                <g:link controller="recipe" action="loginForComments" params="[locator:commentable.locator]"><g:message code="comment.add.title" default="Post a Comment"></g:message></g:link>
            </h2>
        </n:isNotLoggedIn>



</div>
<div id="comments" class="commentable">
	<g:render template="/commentable/comment"
			  collection="${comments}"
			  var="comment"
			  model="[noEscape:noEscape]" />
</div>